deviantART

 

©2006-2008 ~-maverick-
Details
Submitted: May 7, 2006
File Size: 19.9 KB
Image Size: 7.7 KB
Resolution: 263×286
Comments: 4
Favourites & Collections: 11 [who?]

Views
Total: 2,676
Today: 1

Downloads
Total: 1,481
Today: 1

Embed


Thumb

Artist's Comments

DYNAMIC SCROLLBAR CLASS
Author: Simon Coulton (scoulton@hotmail.com - MSN only)
Date: 23/11/2006
Version: 3.0

Availability: ActionScript 2.0; Flash Player 8

Scroller(content:MovieClip, height:Number, "ease:Number,speed:Number", type:String, up:MovieClip, down:MovieClip, dragger:MovieClip, track:MovieClip);
Parameters
content:MovieClip - The content that is going to be scrolled.
height:Number - The height of the mask (Note: Mask is dynamically created)
ease:Number - The amount of easing.
speed:Number - The speed of the scroll / dragger.
type:String - Either: 'click' or 'over' or 'both', click means the user must click the buttons, over will react to rollovers, both will react to clicks and over. Defaults to click.
down:MovieClip - The down button movieclip.
up:MovieClip - The up button movieclip.
dragger:MovieClip - The dragger movieclip.
track:MovieClip - The bar the dragger sits on.

Methods:
init();
- Initialises the scrollbar for use.

disable(type:String,alpha:Number [optional]);
- type can be either a) Hidden b) Trans. If not specified it will default to 'Hidden'.
- alpha can only be set if type is set to 'Trans'. If not specified it will default to 50.

output();
- Outputs either error messages (if Scrollbar creation has failed), or Scrollbar attributes if successful.

Requirements
The following instances must be on the stage for the scrollbar to work.
- Dragger [MovieClip]
- Up button [MovieClip]
- Down button [MovieClip]
- Content [MovieClip]

Example
See Scrollbar.fla for an example.

Notes
This scrollbar will not run any Intervals/EnterFrames when not actually moving to make it easier on slower machines.
Also creates the Mask dynamically so that you don't have to worry about additional layers in your timeline.
** Be sure to have a 0% alpha background inside your content:MovieClip if you are scrolling straight text.
Flash returns text height incorrectly, this is a work around for that. An example of this is in the FLA **

Updates:
2.1
- Added MouseWheel capability.
- Added Key (UP/Down) capability.
3.0
- Complete re-write.
- Added output function.
- Added disable function.
- Scroll calculation fixed.
- maxUp changed on every updateContentPosition() call, allows for dynamically resizing content.
- Error checking for easing/movement speed values.

Fonts used: Supertext, [link]
[x]

Devious Comments

love 0 0 joy 0 0 wow 0 0 mad 0 0 sad 0 0 fear 0 0 neutral 0 0

~-maverick-:icon-maverick-: Aug 9, 2006, 1:53:29 AM
Converted to a class, much simpler, coded better, performs better.
Enjoy :)
~GoPurifyYourself:iconGoPurifyYourself: Jul 13, 2007, 6:53:46 AM
hey man
do you happen to know how to make the content resize when you use dynamic text rendered as html?
cause i've been looking a lot for a dynamic text field with a custom scrollbar.. i couldn't find any.
i hope you understand what i mean cause my english ain't that good..
thanks
~GoPurifyYourself:iconGoPurifyYourself: Jul 13, 2007, 6:55:36 AM
hey man
do you happen to know how to make the content resize when you use dynamic text rendered as html?
cause i've been looking a lot for a dynamic text field with a custom scrollbar.. i couldn't find any.
i hope you understand what i mean cause my english ain't that good..
thanks
~GoPurifyYourself:iconGoPurifyYourself: Jul 13, 2007, 6:57:51 AM
oups sorry for the double.. i got the error mesage 1st time so i thought it didn't send it
[x]

Site Map